package com.ty.day1;

/**
 * Created by IntelliJ IDEA.
 *
 * @author : txy
 * @create : 2023/11/14 9:46
 */
public class TestRectangle {
    public static void main(String[] args) {
        Rectangle rectangle = new Rectangle();
        rectangle.width=3;
        rectangle.height=5;
        System.out.println(rectangle.Grith());
        System.out.println(rectangle.getArea());

        Rectangle r2;
//        System.out.println(r2);//没有初始化
        r2=null;
        System.out.println(r2);
//        System.out.println("Rect"+r2.getArea());//空类型，没有这个方法,空指针异常
        Rectangle r3;
        r3= new Rectangle();
        System.out.println(r3.getWidth());
        System.out.println(r3.getArea());
        Rectangle r4 = new Rectangle();
        r4.width=2;
        r4.height=10;
        System.out.println(r4.getWidth());
        System.out.println(r4.getArea());
        System.out.println(r3==r4);
    }
}
